<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>首页</title>
		<script src="./js/jquery-1.10.2.min.js"></script>
		<link rel="stylesheet" type="text/css" href="./css/style.css"/>
		<script src="./js/jquery.cookie.min.js"></script>
		<style type="text/css">
			.sub{
				cursor: pointer;
				text-align: center;
				margin-top: 20px;
			}
			.sub:hover{
				color: red;
			}
		</style>
	</head>
	<body>
		<div class="app">
			<p class="sub">退出登录</p>
		</div>
		
	
	<script>
		$(function(){
			if(!$.cookie('admin')){
				window.location.href='./src/login.html'
			}

			// 退出登录
			$('.sub').click(function(){
				$.removeCookie('admin', { path: '/' });
				window.location.href='./src/login.html'
			})

		})
		
	</script>
	</body>
</html>